﻿<script src ="/script/jquery.fixedheadertable.js" ></script>
@model Employees
@section ToolBar{
    <div class="r-c-tool">
        <a href="javascript:location.reload();" class="l-btn fa fa-refresh"></a>
        <a href="javascript:void(0);" class="l-btn fa fa-search"></a>
    </div>
    <div class="r-c-list">
        <a class="l-btn cur"  href="#">全部员工</a>
        <a class="l-btn" href="#">已启用员工</a>
        <a class="l-btn" href="#">未启用员工</a>
        @Html.LActionLink("新建员工", "Edit", "Employee", null, new { @class = "l-btn" })
    </div>
    @*<div class="r-c-search fr">
        <label class="relative fl">
            <input class="inp-text bc1" type="text" /><a href="javascript:void(0)" class="fa fa-search absolute c5"></a>
        </label>
        <a href="javascript:void(0)" class="senior-search fl">高级<br />搜索</a>
    </div>*@
}
<div class="l-m-table">
    <tablefor for="EmployeeList">
        <FixedHead></FixedHead>
    </tablefor>
    <table mark="LedinghuoTable" id="EmployeeList">
        <thead>
            <tr class="bgc3">
                <th>员工姓名</th>
                <th>登录号</th>
                <th>手机</th>
                <th>邮箱</th>
                <th>是否可用</th>
                <th>创建时间</th>
                <th class="t-c">操作</th>
            </tr>
        </thead>
        @if (Model==null || Model.Items.Count <= 0) {
            <tr>
                <td colspan="7" class="t-c c0">暂无记录</td>
            </tr>
        }
        @foreach (Employee e in Model.Items)
        {
            <tr>
                <td>@Html.LActionLink(e.EmployeeName,"Detail","Employee", new { id=e.EmployeeId},new { single = "single" })</td>
                <td>@e.LoginNo</td>
                <td>@e.Mb</td>
                <td>@e.Email</td>
                <td>@e.IsActive.StateFormat()</td>
                <td>@e.CreateTime</td>
                <td>
                    @Html.LActionLink("修改", "Edit", "Employee", new { id = e.EmployeeId }, new { single = "single" })
                    @Html.LAjaxPost("删除", new { employeeId = e.EmployeeId, url = Url.Action("Delete", "Employee"), callback = "callbackRemoveTr", tag = "delete" })
                    @Html.LAjaxPost(e.IsActive ? "禁用" : "启用", new { employeeId = e.EmployeeId, isActive = !e.IsActive, url = Url.Action("Active", "Employee") })
                    @Html.LAjaxPost("重置密码", new { employeeId = e.EmployeeId, url = Url.Action("ResetPassword", "Employee") })
                </td>
            </tr>
        }
    </table>
</div>
@section Pager{
   @Html.Pager("Index", "Employee", Model.TotalCount, (int)ViewBag.PageIndex, 20)
}
<script type="text/javascript">
    $(function () {
        $("#EmployeeList").fixedHeaderTable();
    });
</script>